Local variables should not have a prefix. This will distinguish them as being local and not having a scope outside of the current procedure. Here are some examples of declaring variables:
Global gintLoop As Integer
Dim mstrName As String
Private pboolOpen As Boolean
Handles
When programming Windows using the Windows API, youre frequently dealing with handles to windows. Youll also find handles when dealing with the ODBC API. As such, you need a special prefix to identify handles. Use the prefix h to name a handle variable:
Dim hWnd As Long ' Handle to a Window
Dim hEnv As Long ' Handle to the ODBC environment space
Dim hdbc As Long ' Handle to an ODBC data connection
User-defined Types
Declare user-defined types with the prefix typ. Variables that are dimmed of this particular type should also be referenced with a typ prefix. This will help distinguish the setting of elements in a user-defined type from the setting of properties in an object. Heres an example:
Type typCustomer
strName As String
strState As String * 2
lngID as Long
End Type